map

fun <N> map(to: Function<T, out N>, from: Function<in N, T>): ValidatedField<N>

Maps this validation to a new convertible type. The default value will be applied from this delegates current storedValue

The field will be internally managed by this validation as a delegate, so the serialization will take the form of this validation, the widget will be from this, and so on.

Return

ValidatedMapped<N> - A Mapped validation that provides and receives the new type with this as a delegate

Author

fzzyhmstrs

Since

0.5.0

Parameters

N

the new type to map to

to

FunctionN> - maps values from this delegate into the new type

from

Function<N, T> - maps values of the new type back into the type of this delegate


fun <N> map(defaultValue: N, to: Function<T, out N>, from: Function<in N, T>): ValidatedField<N>

Maps this validation to a new convertible type.

The field will be internally managed by this validation as a delegate, so the serialization will take the form of this validation, the widget will be from this, and so on.

Return

ValidatedMapped<N> - A Mapped validation that provides and receives the new type with this as a delegate

Author

fzzyhmstrs

Since

0.5.0

Parameters

N

the new type to map to

defaultValue

N - the default value of the new type

to

FunctionN> - maps values from this delegate into the new type

from

Function<N, T> - maps values of the new type back into the type of this delegate


fun <N> map(to: Function<T, out N>, from: Function<in N, T>, defaultValue: T): ValidatedField<N>

Maps this validation to a new convertible type.

The field will be internally managed by this validation as a delegate, so the serialization will take the form of this validation, the widget will be from this, and so on.

Return

ValidatedMapped<N> - A Mapped validation that provides and receives the new type with this as a delegate

Author

fzzyhmstrs

Since

0.5.0

Parameters

N

the new type to map to

to

FunctionN> - maps values from this delegate into the new type

from

Function<N, T> - maps values of the new type back into the type of this delegate

defaultValue

T - the default value of this delegates type. Mapped to type N with to